/*
 *  cameraSetup.cpp
 *  Ball and Plate
 *
 *  Created by Kenn Sebesta on 2007-11-23.
 *  Copyright 2007 __MyCompanyName__. All rights reserved.
 *
 */
#include <OpenCV/OpenCV.h>
#include "cameraSetup.h"

CvCapture* cameraSetup()
{
	// Set up camera
	CvCapture * camFeed = cvCaptureFromCAM( CV_CAP_ANY );
	
	// Check that the camera exists
	if( !camFeed ) {
		fprintf( stderr, "ERROR: video input is NULL. \n If Linux, check that you have read/write permissions on /dev/video1394/* and /dev/raw1394. \n" );
		exit (1);
	}
	
	//	cvSetCaptureProperty( camFeed, CV_CAP_PROP_FRAME_WIDTH, 640 ); // THESE DON'T WORK RIGHT
	//	cvSetCaptureProperty( camFeed, CV_CAP_PROP_FRAME_HEIGHT, 480 );	
	
	return camFeed;
}